package one.stand.service.checkparam;

import one.stand.request.BusinessCardRequest;
import org.springframework.util.StringUtils;

/**
 * @author Administrator
 */
public class BusinessCardServiceCheckParam {

    /**
     * 创建名片接口入参校验
     *
     * @param request
     * @return
     */
    public static boolean createCardCheckParam(BusinessCardRequest request) {
        if (request.getCompanyId() == null || StringUtils.isEmpty(request.getName()) || StringUtils.isEmpty(request.getPhone()) || request.getStyle() == null||StringUtils.isEmpty(request.getPassword())) {
            return true;
        }
        return false;
    }

    /**
     * 创建名片接口入参校验
     *
     * @param request
     * @return
     */
    public static boolean updateCardCheckParam(BusinessCardRequest request) {
        if (request.getCardId() != null || request.getCompanyId() == null || StringUtils.isEmpty(request.getName()) || StringUtils.isEmpty(request.getPhone()) || request.getStyle() == null) {
            return true;
        }
        return false;
    }
}
